﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SportsPlatform.Base;
using SportsPlatform.Dto.SportBusiness.CompetitionProjec;
using SportsPlatform.Dto.WeChat;
using SportsPlatform.Query.CompetitionProjec;
using SportsPlatform.Query.WeChat;
using SportsPlatform.WeChat.IWeChat;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GetCompetitionListDto = SportsPlatform.Dto.SportBusiness.CompetitionProjec.GetCompetitionListDto;

namespace SportsPlatform.Controllers
{
    [Route("api/[controller]/[action]")]
    [AllowAnonymousAttribute]
    public class WeChatCompetitionController : SportsPlatformControllerBase
    {
        private IWeChatCompetitionService _weChatCompetitionService;

        public WeChatCompetitionController(IWeChatCompetitionService weChatCompetitionService)
        {
            _weChatCompetitionService = weChatCompetitionService;
        }

        /// <summary>
        /// 获取我的赛事列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PagePagingDto<WeChatCompetitionListDto>> GetMeCompetitionList([FromBody] GetWeChatCompetitionQuery query)
        {
            return await _weChatCompetitionService.GetMeCompetitionList(query);
        }

        /// <summary>
        /// 我的赛事详情
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResultDto<WeChatCompetitionDetails>> GetWeChatEmployeeDtoList([FromBody] GetWeChatEmployeeDtoQuery query)
        {
            return await _weChatCompetitionService.GetWeChatEmployeeDtoList(query);
        }

        /// <summary>
        /// 获取赛事项目信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ResultDto<WeChatCompetitionProjectDetails>> GetWeChatCompetitionProjectDetails([FromBody] GetWeChatCompetitionDtoQuery query)
        {
            return await _weChatCompetitionService.GetWeChatCompetitionProjectDetails(query);
        }

        /// <summary>
        /// 获取赛事比赛项目列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<PagePagingDto<GetCompetitionListDto>> GetCompetitionProjecList([FromBody] GetCompentitionProject query)
        {
            return await _weChatCompetitionService.GetCompetitionList(query);
        }
    }
}
